home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / DemoMetalTheme.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  70 lines

  1. /* 
  2.  * @(#)DemoMetalTheme.java    1.1 98/03/10
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21.  
  22. import com.sun.java.swing.plaf.*;
  23. import com.sun.java.swing.plaf.metal.*;
  24. import com.sun.java.swing.*;
  25. import com.sun.java.swing.border.*;
  26. import java.awt.*;
  27.  
  28. /**
  29.  * This class describes a theme using large fonts.
  30.  * It's great for giving demos of your software to a group
  31.  * where people will have trouble seeing what you're doing.
  32.  *
  33.  * @version 1.1 03/10/98
  34.  * @author Steve Wilson
  35.  */
  36. public class DemoMetalTheme extends DefaultMetalTheme {
  37.  
  38.     public String getName() { return "Presentation"; }
  39.  
  40.     private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 18);
  41.     private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 18);
  42.     private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 18);
  43.     private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 14);
  44.  
  45.     public FontUIResource getControlTextFont() { return controlFont;}
  46.     public FontUIResource getSystemTextFont() { return systemFont;}
  47.     public FontUIResource getUserTextFont() { return userFont;}
  48.     public FontUIResource getMenuTextFont() { return controlFont;}
  49.     public FontUIResource getWindowTitleFont() { return controlFont;}
  50.     public FontUIResource getSubTextFont() { return smallFont;}
  51.  
  52.     public void addCustomEntriesToTable(UIDefaults table) {
  53.          super.addCustomEntriesToTable(table);
  54.  
  55.          final int internalFrameIconSize = 16;
  56.          table.put("InternalFrameTitlePane.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize));
  57.          table.put("InternalFrameTitlePane.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize));
  58.          table.put("InternalFrameTitlePane.iconizeIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize));
  59.          table.put("InternalFrameTitlePane.altMaximizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize));
  60.  
  61.  
  62.  
  63.          table.put( "ScrollBar.width", new Integer(21) );
  64.  
  65.  
  66.  
  67.     }
  68.  
  69. }
  70.